<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>switch语句</title>
</head>
<body>
	<script type="text/javascript">
		var weather = 'rainy';
		switch (weather) {
			case 'sunny':
				alert(1);
				break;
			case 'rainy':
				alert(2);
				// 编写switch语句 小心break,cash穿透
				break;
			case 'snowing':
				alert(3);
				break;
			default:
				alert(4);
				break;
		}
	</script>
</body>
</html>